package com.fsquare.controller.shipping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller(value="shippingController")
@RequestMapping("/shipping")
public class ShippingController {
	
//	@Resource(name = "fsquareShippingService")
//	protected ExtFulfillmentOptionService shippingService;
//	
//	
//	@RequestMapping(value = "/get", produces = "application/json", method = RequestMethod.GET)
//    @ResponseBody
//    public Map<String, Object> getShipping(HttpServletRequest request, HttpServletResponse response){
//		Map<String, Object> result = new HashMap<String, Object>();
//    	String optionId = request.getParameter("optionId");
//    	FulfillmentOption fulfillmentOption = shippingService.getShippingMethodById(Long.parseLong(optionId));
//    	//result.put("fulfillmentOption", fulfillmentOption);
//    	result = getObjectMap(fulfillmentOption);
//		return result;
//	}
//	
//	@RequestMapping(value = "/getAll", produces = "application/json", method = RequestMethod.GET)
//    @ResponseBody
//    public Map<String, Object> getAllShipping(HttpServletRequest request, HttpServletResponse response){
//		Map<String, Object> result = new HashMap<String, Object>();
//		List<FulfillmentOption> fulfillmentOptionList = shippingService.getAllShippingMethods();
//		result.put("fulfillmentOptionList", fulfillmentOptionList);
//		//getObjectMap(FulfillmentOption fulfillmentOption)
//		return result;
//	}
//	
//	@RequestMapping(value = "/getBands", produces = "application/json", method = RequestMethod.GET)
//    @ResponseBody
//    public Map<String, Object> getShippingPricingBandsByOption(HttpServletRequest request, HttpServletResponse response){
//		Map<String, Object> result = new HashMap<String, Object>();
////		List<FulfillmentOption> fulfillmentOptionList = shippingService.getAllShippingMethods();
////		result.put("fulfillmentOptionList", fulfillmentOptionList);
//		return null;
//	}
//	
//	@RequestMapping(value = "/save", produces = "application/json", method = RequestMethod.POST)
//    @ResponseBody
//    public Map<String, Object> saveShipping(HttpServletRequest request, HttpServletResponse response){
//		return null;
//	}
//	
//	@RequestMapping(value = "/delete", produces = "application/json", method = RequestMethod.POST)
//    @ResponseBody
//    public Map<String, Object> deleteShipping(HttpServletRequest request, HttpServletResponse response){
//		return null;
//	}
//	
//	@RequestMapping(value = "/deleteBand", produces = "application/json", method = RequestMethod.POST)
//    @ResponseBody
//    public Map<String, Object> deleteShippingPricingBand(HttpServletRequest request, HttpServletResponse response){
//		return null;
//	}
//	
//	public Map<String, Object> getObjectMap(FulfillmentOption fulfillmentOption){
//		
//		Method[] methods = fulfillmentOption.getClass().getDeclaredMethods();
//		
//		
//		
//		
//		Map<String, Object> result = new HashMap<String, Object>();
//		if(fulfillmentOption != null){
//			result.put("id", fulfillmentOption.getId());
//			result.put("name", fulfillmentOption.getName());
//			result.put("longDescription", fulfillmentOption.getLongDescription());
//			result.put("useFlatRates", fulfillmentOption.getUseFlatRates());
//			result.put("taxCode", fulfillmentOption.getTaxCode());
//			result.put("taxable", fulfillmentOption.getTaxable());
//			
//		}
//		return result;
//	}
//	
//	public Map<String, Object> getObjectMap(FulfillmentPriceBand fulfillmentPriceBand){
//		Map<String, Object> result = new HashMap<String, Object>();
//		if(fulfillmentPriceBand != null){
//			result.put("id", fulfillmentPriceBand.getId());
//			result.put("resultAmount", fulfillmentPriceBand.getResultAmount());
//			result.put("retailPriceMinimumAmount", fulfillmentPriceBand.getRetailPriceMinimumAmount());
////			result.put("useFlatRates", fulfillmentOption.getUseFlatRates());
////			result.put("taxCode", fulfillmentOption.getTaxCode());
////			result.put("taxable", fulfillmentOption.getTaxable());
//			
//		}
//		return result;
//	}
//	
//	public FulfillmentPriceBand buildObjectMap(Map<String, Object> map){
//		return null;
//	}
}
